package SV_WEAK_TLS;
import javax.net.ssl.*;
import java.io.IOException;

public class Fixed_02 {
    public class Test {
        public void test() throws IOException {
            SSLSocket socket = null;
            try {
                SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
                socket = (SSLSocket) factory.createSocket("abc.com", 443);
                socket.setEnabledProtocols(new String[] {"TLSv1.2"});
                socket.startHandshake();
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                if (socket != null) {
                    socket.close();
                }
            }
        }
    }

}
